import request from '@/utils/request'

// export const loginAPI = (data) => {
//   return request.post('/park/login', data)
// }
export const loginAPI = (data) => {
  return request({
    url: '/park/login',
    method: 'post',
    data
  })
}
export const getUserInfoAPI = () => {
  return request.get('/system/user/dropList')
}
export const getCardListAPI = (data) => {
  return request.get('/parking/card/list', data)
}
export function createCardAPI(data) {
  return request({
    url: '/parking/card',
    method: 'POST',
    data
  })
}
export const getCardDetailAPI = (id) => {
  return request.get(`/parking/card/${id}`)
}
export function exitCardDetailAPI(data) {
  return request({
    url: '/parking/card/edit',
    method: 'PUT',
    data
  })
}
export const delCardAPI = (id) => {
  return request.delete(`parking/card/${id}`)
}
export function delAllCardAPI(id) {
  return request({
    url: `/parking/card/${id.join(',')}`,
    method: 'DELETE'
  })
}
/**
 * @description: 获取用户信息
 * @param {*} data {}
 * @return {*} promise
 */
export function getProfileAPI() {
  return request({
    url: '/park/user/profile',
    method: 'GET'
  })
}

